package cn.zebra.dev.order.module.item.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * @author runnable@sina.cn
 */
@ToString
@Getter
@Setter
@TableName("orders_item")
public class OrdersItemEntity {

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "订单id", hidden = true)
    private Long ordersId;

    @ApiModelProperty(value = "购物车Id", hidden = true)
    private Long cartId;

    @ApiModelProperty(value = "商品id", hidden = true)
    private Long productId;

    @ApiModelProperty(value = "商品SkuId", hidden = true)
    private Long productSkuId;

    @ApiModelProperty("商品名称")
    private String productName;

    @ApiModelProperty("商品图片")
    private String productImage;

    @ApiModelProperty("购买时商品属性值 (数组格式:[金色, 16GB])")
    private String productAttributes;

    @ApiModelProperty(value = "消耗的积分(单商品总共消耗的积分)", hidden = true)
    private Long point;

    @ApiModelProperty(value = "奖励的积分(单商品总共奖励的积分)", hidden = true)
    private Long returnPoint;

    @ApiModelProperty(value = "数量")
    private Long num;

    @ApiModelProperty("单价")
    private BigDecimal unitPrice;

    @ApiModelProperty("商品总价")
    private BigDecimal totalPrice;

    @TableField(exist = false)
    @ApiModelProperty(value = "店铺id", hidden = true)
    private Long shopId;
}
